<?php echo $this->atheme->form_open('', array('label'=>'', '')); ?>

      <!-- Nav tabs -->
      <ul class="nav nav-tabs">
         <li class="active"><a href="#home" data-toggle="tab">General</a>
         </li>
         <li><a href="#cache" data-toggle="tab">Cache</a>
         </li>
         <li><a href="#email" data-toggle="tab">Email</a>
         </li>
         <li><a href="#settings" data-toggle="tab">Images</a></li>
         <li><a href="#admin" data-toggle="tab">Admin</a></li>
      </ul>
      <!-- Tab panes -->
      <div class="tab-content">
         <div id="home" class="tab-pane fade in active">
            <h4>Site Configurations</h4>
            <?php 
            if(isset($edit['default']) && $edit['default'])
            foreach($edit['default'] as $setting)
            { ?>
            <?php echo $this->atheme->input($setting->title, 'edit['.@$setting->setting_name.']', set_value('edit['.@$setting->setting_name.']', @$setting->value), array('help'=> @$setting->description)); ?>
            
            <?php } ?>
            </div>
            <div id="cache" class="tab-pane fade">
               <h4>Cấu hình Cache</h4>
               
               <fieldset>
                <div class="form-group">
                   <label class="col-sm-2 control-label">Trạng thái</label>
                   <div class="col-sm-10">
                      <label class="switch">
                         <input type="checkbox" <?php echo (@$edit['cache']['cms_cache_enalbe']->value)?'':'checked="checked"'?> class="btn-switch" name="edit[cms_cache_enalbe]" value="1">
                         <span></span>
                      </label>
                   </div>
                </div>
             </fieldset>
               <div class="switch_cache">
               <?php
            if(isset($edit['cache']) && $edit['cache'])
            {
            unset($edit['cache']['cms_cache_enalbe']);
            foreach($edit['cache'] as $setting)
            { ?>
            <?php echo $this->atheme->input($setting->title, 'edit['.@$setting->setting_name.']', set_value('edit['.@$setting->setting_name.']', @$setting->value), array('help'=> @$setting->description)); ?>
            
            <?php } } ?>
               </div>
               </div>
               <div id="email" class="tab-pane fade">
                  <h4>Email</h4>
                   <?php
            if(isset($edit['mail']) && $edit['mail'])
            {
            // unset($edit['email']['cms_cache_enalbe']);
            foreach($edit['mail'] as $setting)
            { ?>
            <?php echo $this->atheme->input($setting->title, 'edit['.@$setting->setting_name.']', set_value('edit['.@$setting->setting_name.']', @$setting->value), array('help'=> @$setting->description)); ?>
            
            <?php } } ?>
                  </div>
                  <div id="settings" class="tab-pane fade">
                     <h4>Settings Tab</h4>
                     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                     </div>
                      <div id="admin" class="tab-pane fade">
                     <h4>Admin setting</h4>
                     <?php
            if(isset($edit['admin']) && $edit['admin'])
            {
            foreach($edit['admin'] as $setting)
            { ?>
            <?php echo $this->atheme->input($setting->title, 'edit['.@$setting->setting_name.']', set_value('edit['.@$setting->setting_name.']', @$setting->value), array('help'=> @$setting->description)); ?>
            
            <?php } } ?>
                     </div>
                  </div>
<?php echo $this->atheme->form_submit(array(),array(), 1); ?>
<?php echo $this->atheme->form_close(); ?>

<style type="text/css">
   .switch_cache{
      line-height: 1.5em;
        color: #000;
   }
   .switch_cache b{
        font-size: 17px;
   }
</style>
<script type="text/javascript">
   $('.btn-switch').click(function (){
      if($(this).is(':checked'))
      {
         $('.switch_cache').css('opacity', 1);
      }
      else
      {
         $('.switch_cache').css('opacity', 0.7);
      }
   });
   $('.btn-switch').trigger('click');
</script>